package com.jiaming.restaurant.api.common.exception;

import com.jiaming.restaurant.api.common.response.ResultCodeEnum;
import lombok.Data;

/**
 * @author dragon
 * @create 2021-03-01 22:22
 */
@Data
public class ApiException extends RuntimeException{

    private int code;

    private String msg;

    private String datail;

    public ApiException(ResultCodeEnum resultCodeEnum,String datail) {
        this.code = resultCodeEnum.getCode();
        this.msg = resultCodeEnum.getMsg();
        this.datail = datail;
    }

    public ApiException(String datail) {
        this.datail = datail;
    }

    public ApiException(int code, String msg, String datail) {
        this.code = code;
        this.msg = msg;
        this.datail = datail;
    }
}
